import java.util.Scanner;

public class HW5 {
    public static void main(String[] args) {
        Scanner input =new Scanner(System.in);
        int sum=0;
        int i=1;
        do {
            int num;
            System.out.println("请输入五个人中第"+i+"个人的年龄:");
            num =input.nextInt();
            if (130<num||num<0){
                System.out.println("输入错误");
                return;
            }
            else {
                sum+=num;
                i++;
            }
        }while (i<=5);
        int mul=sum/5;
        System.out.println("平均年龄为："+mul);
    }
}
